package com.bi.autotest.cases;

import com.auto.base.Assertion;
import com.auto.base.InitAppium;
import com.bi.autotest.operations.MyLoginOperation;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.net.MalformedURLException;

/**
 * Created by yidian on 2018/3/27.
 */
public class MyLogin extends InitAppium{

    private MyLoginOperation myLoginOperate;

    @BeforeClass
    public void initDriver(){
        try {
            setUp();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        Assert.assertNotNull(driver);
        myLoginOperate = new MyLoginOperation(driver);
    }

    /**
     * 测试用户名、密码都正确的情况
     */
    @Test(priority = 0)
    public void loginCorrect(){
        boolean isLoginPage=myLoginOperate.LoginPre();
        Assertion.verifyEquals(isLoginPage,true,"判断是否进入了登录页面");
        print("判断是否进入了登录页面："+isLoginPage);
        boolean isLoginSucess=myLoginOperate.login("15210523096","999999");
        Assertion.verifyEquals(isLoginSucess,true,"用户名、密码都正确的情况下 是否登录成功");
        print("用户名、密码都正确的情况下 是否登录成功："+isLoginSucess);
    }







}
